<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tab.css" />
<?php
$this->breadcrumbs=array(
	'Purchase Requisition',
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
    $('.search-form').slideToggle('fast');
    return false;
});
$('.search-form form').submit(function(){
    $.fn.yiiGridView.update('purchase-requisition-grid', {
        data: $(this).serialize()
    });
    return false;
});
");

?>

<div class="col-xs-10">
<div class="page-content">
<div class="page-header">

<h1>Purchase Requisition</h1>
<hr />


<div class="tabcontainer">
        
            <div class="tabbox">
                <ul>
                    <li class="tabon"><a href="<?php echo Yii::app()->createUrl('Imb/ImbJenis') ?>" rel="Propinsi / Dati2">New</a></li>
					<li class="taboff"><a href="<?php echo Yii::app()->createUrl("Imb/ImbJenisPembangunan"); ?>" rel="Kecamatan">On Going</a></li>
					<li class="taboff"><a href="<?php echo Yii::app()->createUrl("Imb/ImbDokumen"); ?>" rel="Kelurahan">Pending</a></li>
					<li class="taboff"><a href="<?php echo Yii::app()->createUrl("Imb/ImbDokumen"); ?>" rel="Kelurahan">Rejected</a></li>
                </ul>
            </div>
           
            
            <div class="clr"></div>
            <div class="tabbackbox">


<?php 
$this->beginWidget('zii.widgets.CPortlet', array(
	'htmlOptions'=>array(
		'class'=>''
	)
));
$this->widget('bootstrap.widgets.TbMenu', array(
	'type'=>'pills',
	'items'=>array(
		array('label'=>'Create', 'icon'=>'icon-plus', 'url'=>Yii::app()->controller->createUrl('create'), 'linkOptions'=>array()),
                array('label'=>'List', 'icon'=>'icon-th-list', 'url'=>Yii::app()->controller->createUrl('index'),'active'=>true, 'linkOptions'=>array()),
		array('label'=>'Search', 'icon'=>'icon-search', 'url'=>'#', 'linkOptions'=>array('class'=>'search-button')),
		array('label'=>'Export to PDF', 'icon'=>'icon-download', 'url'=>Yii::app()->controller->createUrl('GeneratePdf'), 'linkOptions'=>array('target'=>'_blank'), 'visible'=>true),
		array('label'=>'Export to Excel', 'icon'=>'icon-download', 'url'=>Yii::app()->controller->createUrl('GenerateExcel'), 'linkOptions'=>array('target'=>'_blank'), 'visible'=>true),
	),
));
$this->endWidget();
?>



<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->


<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'purchase-requisition-grid',
	'dataProvider'=>$model->search(),
        'type'=>'striped bordered condensed',
        'template'=>'{summary}{pager}{items}{pager}',
	'columns'=>array(
		array(
			'name'=>'trans_date',
			'value'=>'date("d-m-Y",strtotime($data->trans_date))',
			),
		'purchase_requisition_number',
		array(
			'name'=>'part_name',
			'value'=>'$data->part->name',
			),
		'id_section',
		'remarks',
		'status',
		
		/*
		'part_name',
		'part_description',
		'part_specs',
		'qty',
		'uom',
		'expected_received_date',
		'remarks',
		'status',
		'created',
		'created_by',
		'modified',
		'modified_by',
		'budget_number',
		'revised_from',
		'app1_by',
		'app1_date',
		'app2_by',
		'app2_date',
		'app3_by',
		'app3_date',
		'app4_by',
		'app4_date',
		'app5_by',
		'app5_date',
		'app6_by',
		'app6_date',
		'part_code',
		'price',
		'currency',
		'status_po',
		'supplier_code',
		'reject_date',
		'pending_date',
		'budget_price',
		'data_reject_remark',
		*/
       array(
            'class'=>'bootstrap.widgets.TbButtonColumn',
			'template' => '{view} {update} {delete}',
			'buttons' => array(
			      'view' => array(
					'label'=> 'View',
					'options'=>array(
						'class'=>'btn btn-small view'
					)
				),	
                              'update' => array(
					'label'=> 'Update',
					'options'=>array(
						'class'=>'btn btn-small update'
					)
				),
				'delete' => array(
					'label'=> 'Delete',
					'options'=>array(
						'class'=>'btn btn-small delete'
					)
				)
			),
                  'htmlOptions'=>array('style'=>'width: 160px'),
           )
	),
)); ?>

</div>
</div>


</div>
</div>
</div>